<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>砂石管理系统</title>
    <link th:href="@{/css/login.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/css/body.css}" rel="stylesheet" type="text/css">
    <script type="text/javascript" th:src="@{/plugins/jquery-easyui-1.5.5.5/jquery.min.js}"></script>
</head>
<body>
<input type="hidden" value="LoginPageHtml" id="loginFlag">
<div class="container">
    <section id="content">

            <h1>用户登录</h1>
            <div>
                <input type="text" placeholder="用户名" required="" id="username" />
            </div>
            <div>
                <input type="password" placeholder="密码" required="" id="password" />
            </div>
            <div class="">
                <span class="help-block u-errormessage" id="js-server-helpinfo" style=";line-height: 40px;text-align: left;padding-left: 15px;color: red;display: none;">&nbsp;用户名密码错误请重新输入</span>
            </div>
            <div style="padding: 5px 0 20px 0;">
                <!-- <input type="submit" value="Log in" /> -->
                <input type="button" value="登录" class="btn btn-primary" id="js-btn-login" style="padding:5px 20px;font-size:14px;"/>
                <!-- <a href="#">Register</a> -->
            </div>

    </section><!-- content -->
</div>
<!-- container -->


<!--<br><br><br><br>-->
<!--<div style="text-align:center;">-->
    <!--<p>来源:More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></p>-->
<!--</div>-->


<script type="text/javascript">
    $(function () {
        $("#js-btn-login").on("click",function(){
                var username = $("#username").val();
                var password = $("#password").val();
                $.post("/loginUser",{"username":username,"password":password},function (data) {
                    if(data=="true"){
                        $("#js-server-helpinfo").css("display","none");
                        window.location.href="/index";
                    }else{
                        $("#js-server-helpinfo").css("display","block");
                    }

                })

        })
    })
</script>

</body>
</html>